package com.studyv3.test.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.studyv3.common.core.domain.AjaxResult;
import com.studyv3.system.mapper.SysUserMapper;
import com.studyv3.test.domain.ApplyProduct;
import com.studyv3.test.mapper.ApplyProductMapper;
import com.studyv3.test.mapper.BatchMapper;
import com.studyv3.test.mapper.ProductsMapper;
import com.studyv3.test.service.ApplyApprovalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * <p>
 * lb_购买申请/审批 服务实现类
 * </p>
 *
 * @author author
 * @since 2024-05-07
 */
@Service
public class ApplyApprovalServiceImpl extends ServiceImpl<ApplyProductMapper, ApplyProduct> implements ApplyApprovalService {

    @Autowired
    ApplyProductMapper applyProductMapper;
    @Autowired
    BatchMapper batchMapper;
    @Autowired
    SysUserMapper sysUserMapper;
    @Autowired
    ProductsMapper productsMapper;


    @Override
    public AjaxResult agreeOrReject(ApplyProduct applyProduct) {
        applyProduct.setApprovalTime(LocalDateTime.now());
        if(applyProductMapper.updateById(applyProduct)>0)
        { return AjaxResult.success("审批成功");}

        return AjaxResult.error("出错了");
    }


}


